<?php
/**
 * Created by PhpStorm.
 * User: qzy008
 * Date: 2018/9/21
 * Time: 17:09
 */

namespace app\api\validate\category;

use app\common\validate\BaseValidate;

class CategoryCreateOrEdit extends BaseValidate
{
    protected $rule = [
        'id' => 'require|isPositiveInteger',
        'title' => 'require|isNotEmpty'
    ];

    protected $message = [
        'id' => 'id必须是正整数',
        'title' => '文章分类名称不能为空'
    ];

    protected $scene = [
        'create' => ['title' => 'require|isNotEmpty']
    ];
}